# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-subunit
pkgver=1.4.4
pkgrel=1
pkgdesc="Python implementation of subunit test streaming protocol"
arch=('any')
license=('Apache')
url="https://launchpad.net/subunit"
depends=('python-iso8601' 'python-testtools')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('python-fixtures' 'python-hypothesis' 'python-testscenarios')
source=("https://github.com/testing-cabal/subunit/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('a666e45951afab70ea85cf9614d5e60c8884c0e2d7987e690bf7acedec5c544c412407b02134a125b4dca8772c0b1ce17fdbd9546d97ef06592119ec49b2a21f')

build() {
  cd subunit-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd subunit-$pkgver
  PYTHONPATH="$PWD/build/lib" python -m testtools.run subunit.test_suite || echo "Tests failed"
}

package() {
  cd subunit-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
